/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.andersonlab.trailsdm.control;

import java.util.LinkedHashSet;

/**
 * DataConduit gets redirected into a GWT RPC servelet
 * when combined with the GWT portion of the learning Trail code
 * @author jcanderson
 */
public interface DataConduit {
    public void retrieve(String uuid, RetrievalCallBack<Datum> callback);
    public void retrieveList(LinkedHashSet<String> uuids, ListCallBack<Datum> callback);
    public void save(Datum datum, ChangeCallBack callback);
            
    public interface ListCallBack<T extends Datum> {
        public void onSuccess(LinkedHashSet<T> list);
        public void onFailure();
    }
    
    public interface RetrievalCallBack<T extends Datum> {
        public void onSuccess(T datum);
        public void onFailure();
    }
    
    public interface ChangeCallBack {
        public void wasSuccessful(boolean wasit);
    }
            
}
